
package guoan.core.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;

/**
 * ClassName:FilterConfig <br/>
 * Function: TODO ADD FUNCTION. <br/>
 * Reason: TODO ADD REASON. <br/>
 * Date: 2015年2月5日 下午3:26:49 <br/>
 * 
 * @version
 * @since JDK 1.7
 * @see
 */
@Configuration
public class CacheConfiguration {

    @Bean(name = "accessTokenCache")
    public Cache<String, String> guavaCacheManager(){
        String spec = "maximumSize=10,expireAfterWrite=7000s";
        Cache<String, String> cache = CacheBuilder.from(spec).build();
        return cache;
    }

}
